//
//  HomeChangyongCell.swift
//  ZYA
//
//  Created by 邱仙凯 on 2024/12/2.
//  Copyright © 2024 zwb. All rights reserved.
//

import UIKit
 
class HomeChangyongCell: BadgeCollectionViewCell {
    
    var img: UIImageView = {
        let img = UIImageView()
        return img
    }()
    var title: UILabel = {
        let lab :UILabel = UILabel()
        lab.textColor = UIColor.white
        lab.font = UIFont.systemFont(ofSize: 13)
        lab.textAlignment = .center
        lab.numberOfLines = 2
        return lab
    }()
 
    
    convenience required init(coder : NSCoder){
        self.init()
    }

    override init(frame: CGRect) {
        super.init(frame: frame)
        self.initUtil()
    }
    
    func initUtil() {
        self.contentView.backgroundColor = .clear
         
        self.contentView.addSubview(img)
        img.snp.makeConstraints { (make) in
            make.centerX.equalTo(self.contentView)
            make.centerY.equalTo(self.contentView).offset(-14)
            make.width.equalTo(self.contentView).multipliedBy(0.64)
            make.height.equalTo(img.snp.width)
      
        }
        self.contentView.addSubview(title)
        title.snp.makeConstraints { (make) in
            make.centerX.equalTo(self.contentView)
            make.left.right.equalTo(self.contentView)
            make.top.equalTo(img.snp.bottom).offset(6)
        }
        
        
    }
}
